<!DOCTYPE html>
<html>

<head>
<title>Conic by one polar pair, two points and one line</title>
<meta charset="UTF-8">
<script type="text/javascript" src="../build/js/Cindy.js"></script>
<script type="text/javascript">

var cdy = CindyJS({ // See ref/createCindy documentation for details.
  ports: [{id: "CSCanvas", width: 500, height: 500}],
  scripts: "cs*",
  language: "en",
  defaultAppearance: {
  },
  geometry: [
    {name:"A", type:"Free", pos:[-1,2], color:[0,1,1]},
    {name:"a", type:"FreeLine", pos:[1,0,1], color:[1,0,0]},
    {name:"B", type:"Free", pos:[2,-1], color:[1,1,0]},
    {name:"C", type:"Free", pos:[5,2], color:[1,1,0]},
    {name:"d", type:"FreeLine", pos:[1,0,-1], color:[0.5,0,0.7]},
    {name:"Qs", type:"ConicBy1Pol2P1L", args:["A","a","B","C","d"]},
    {name:"Q1", type:"SelectConic", args:["Qs"], color:[0,0.5,0.5], pos:{xx:-0.3,yy:0.1,zz:1,xy:0.4,xz:0.5,yz:0.1}},
    {name:"Q2", type:"SelectConic", args:["Qs"], color:[0,0,1], pos:{xx:-0.1,yy:0.4,zz:1,xy:0.5,xz:-0.7,yz:-1.1}},
    {name:"aa", type:"PolarOfPoint", args:["A", "Q1"], color:[0,0.7,0], size:1.5},
  ]
});

function ex1() {
  cdy.evokeCS(
    "A.homog = [-1,2,1];" +
    "a.homog = [1,0,1];" +
    "B.homog = [0.88,1,0.133];" +
    "C.homog = [1,-0.98,0.27];" +
    "d.homog = [0.006,0.13076,1];");
}
</script>
</head>

<body style="font-family:Arial;">
  <h1>Conic by one polar pair, two points and one line</h1>
  <div id="CSCanvas" style="border:2px solid black"></div>
  <p>You should <em>not</em> be seeing a red line in this example,
    since it should be covered by a green line in the same
    location.</p>
  <p>If the cyan point is located on the green line, this gives you
    access to conics which touch a given tangent in a given
    point of contact.</p>
  <p>In <a href="javascript:ex1()">this configuration</a>, moving the
    bottommost point will cause the conics to switch roles unless
    avoided by complex tracing.</p>
</body>

</html>
